<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>   
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-1.4.4.min.js"></script>
<script src="${pageContext.request.contextPath }/js/jquery-2.js"></script>
<script src="${pageContext.request.contextPath }/js/jquery.validate.js"></script>
<script type="text/javascript">
	$(function() {
		$("#addUser").validate({
			rules : {
				'userName' : {
					required : true,
					minlength : 2
				},
				'password' : {
					required : true,
					minlength : 2
				},
				'password2' : {
					required : true,
					minlength : 2,
					equalTo : "#password"
				}
			},
			messages : {
				'userName' : {
					required : "请输入姓名",
					minlength : "必须由两个字符组成"
				},
				'password' : {
					required : "请输入密码",
					minlength : "不能少于2位字符"
				},
				'password2' : {
					required : "请再次输入密码",
					equalTo : "两次密码输入不相同",
					minlength : "不能少于2位字符"
				}
			}
		});
	});
</script>
</head>

<body>
	<s:form action="addUser" namespace="/user" id="addUser" name="addUser">
		<!-- <s:hidden name="studentId" value="%{studentId}"></s:hidden> -->

		<table cellSpacing=0 cellPadding=5  border=0>
			<tr>
				<td>职工姓名：</td>
				<td>
					<s:textfield name="userName" class="textbox" id="" style="WIDTH: 180px" maxLength="50" />
				</td>
			</tr>
			<tr>
				<td>密码 ：</td>
				<td>
					<s:password name="password" class="textbox" id="password" />
				</td>
			</tr>
			<tr>	
											

				<td>请再次输入 ：</td>
				<td>
					<s:password name="password2" class="textbox" id="password2" />
				
				</td>
				
			</tr> 
			
			<tr>
				<td rowspan=2>
					<s:submit value="提交"/>
					<%-- <input type=submit value=" 保存 " > --%>
				</td>
			</tr>

		</table>
	</s:form>
</body>
</html>